import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

const store = new Vuex.Store({
	state: {
		config: {}, // 店铺配置信息
		orderTab: 0, // 选中的订单tab页
		redirectPage: '',
		uuid:'',//当前客户端
		searchStyle: '',
		searchFixed:false,//搜索框样式
		userShip: {}, //地区信息
		invoice: {}, //发票信息
		shopAddress: {}, // 选择门店地址
		tabbarList: [{
				iconPath: "https://diy.cdevelopment.cn/admin-api/infra/file/18/get/09775f24a1d92c9e0191b2b32e03835a3b4101e07fc68f471c33eda6b8fa2d01.png",
				selectedIconPath: "https://diy.cdevelopment.cn/admin-api/infra/file/18/get/f07c8b9ff4261bd918eda0b40f0d55dedd8be74d83b0442fd8277ce5a560cbce.png",
				text: '首页',
				pagePath:'/pages/index/index'
			},
			{
				iconPath: "https://diy.cdevelopment.cn/admin-api/infra/file/18/get/810e332fcf55a23164c7fabf18f2a4e3f60dba7e379d0351dd7239d272ccff1b.png",
				selectedIconPath: "https://diy.cdevelopment.cn/admin-api/infra/file/18/get/dcf7207a094a5ceafdd921b5e9652bab8488a8e1edf97c301306d4752540b3b8.png",
				text: '社区',
				pagePath:'/pages/community/index'
			},
			{
				iconPath: "https://diy.cdevelopment.cn/admin-api/infra/file/18/get/00dd0b51adc323773b95690f6ae364b4a6e9fc1fe581cd7c0b39604643c2f92a.png",
				selectedIconPath: "https://diy.cdevelopment.cn/admin-api/infra/file/18/get/00dd0b51adc323773b95690f6ae364b4a6e9fc1fe581cd7c0b39604643c2f92a.png",
				text: '',
				midButton: true,
				pagePath:'/pages/product/index'
			},
			{
				iconPath: "https://diy.cdevelopment.cn/admin-api/infra/file/18/get/aa18bf343c1c51f06c1a41a55e35606a1c0a973fb0a99854421da7e5a42b6a08.png",
				selectedIconPath: "https://diy.cdevelopment.cn/admin-api/infra/file/18/get/8e05e4f6d7b79795b695d6e54b45cca6b206708996ba9583d7cc6385b379d958.png",
				text: '购物车',
				customIcon: false,
				pagePath:'/pages/cart/index'
			},
			{
				iconPath: "https://diy.cdevelopment.cn/admin-api/infra/file/18/get/ba851763cbbb7facf14ab3dd5a87b4e81cda8cac77e68280262d3cbc517b0e1c.png",
				selectedIconPath: "https://diy.cdevelopment.cn/admin-api/infra/file/18/get/0c2ac01398e15445463e0d1d7057e77513d3e80d8147b198853b81364920094b.png",
				text: '我的',
				pagePath: '/pages/user/index',
			},
		],
	},
    mutations: {
		config (state, payload) {
			state.config = payload
		},
		orderTab (state, tab) {
			state.orderTab = tab
		},
		redirect (state, payload) {
			state.redirectPage = payload.page
		},
		searchStyle (state, style) {
			state.searchStyle = style
		},
		searchFixed (state, payload) {
			state.searchFixed = payload
		},
		userShip (state, userShip) {
			state.userShip = userShip
		},
		invoice (state, invoice) {
			state.invoice = invoice
		},
		changeAddress (state, value) {
			state.shopAddress = value
		}
	},
	actions: {

	},
	getters: {
		shopConfig: state => state.config,
		uuid: state	=>	state.uuid,
	}
})

export default store
